#include "stdafx.h"
#include "YLockedObject.h"

namespace ysimple_system
{
	

	YCriticalSection::YCriticalSection()
	{
		InitializeCriticalSection(&m_critical_section);
	}

	YCriticalSection::~YCriticalSection()
	{
		DeleteCriticalSection(&m_critical_section);
	}

	void YCriticalSection::lock()
	{
		EnterCriticalSection(&m_critical_section);
	}

	void YCriticalSection::unlock()
	{
		LeaveCriticalSection(&m_critical_section);
	}

}